import yaml,logging,yagmail

def yaml_loc(filename):
    with open(filename,'r',encoding='utf-8') as f:
        return yaml.safe_load(f)

def logging_loc():
    logging.basicConfig(
        filemode='a+',
        filename='log.txt',
        format='%(asctime)s - %(levelname)s : %(name)s',
        level=logging.DEBUG
    )

def email(filename):
    send = yagmail.SMTP(user='1048151889@qq.com',password='bgdaesrbodjxbbfi',host='smtp.qq.com')
    send.send(to='1048151889@qq.com',subject='图书系统测试报告',contents='图书系统测试报告',attachments=filename)